
<%@page import="workboard.WorkboardVo"%>
<%@page import="workboard.Workboard"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style>
.worksmodify-main {
	width: 500px;
	height: 450px;
	font-family: 'Nanum Gothic', sans-serif;
}

.worksmodify-main input, .worksmodify-main textarea{
	font-family: 'Nanum Gothic', sans-serif;
}

.worksmodify-top {
	width: 500px;
	height: 380px;
	float: left;
}

.worksmodify-top-title,.worksmodify-top-title2,.worksmodify-top-title3 {
	width: 100px;
	height: 50px;
	float: left;
	margin: 10px;
	color: white;
	text-align: center;
	line-height: 50px;
	vertical-align: middle;
	background-color: #160952;
}

.worksmodify-top-title4 {
	width: 100px;
	height: 150px;
	float: left;
	margin: 10px;
	color: white;
	text-align: center;
	line-height: 150px;
	vertical-align: middle;
	background-color: #160952;
}

.worksmodify-top-item,.worksmodify-top-item2,.worksmodify-top-item3 {
	width: 360px;
	height: 50px;
	float: left;
	margin: 10px;
}

.worksmodify-top-item4 {
	width: 360px;
	height: 150px;
	float: left;
	margin: 10px;
}

.worksmodify-top-item input {
	width: 100%;
	height: 88%;
	font-size: 25px;
	border: 1px solid silver;
}

.worksmodify-top-item2 input {
	width: 100%;
	height: 88%;
	font-size: 25px;
	border: 1px solid silver;
}

.worksmodify-top-item4 textarea {
	width: 99%;
	height: 95%;
	font-size: 25px;
	border: 1px solid silver;
}

.worksmodify-bottom {
	width: 500px;
	height: 60px;
	float: left;
	border-top: 1px solid silver;
}

.worksmodify-bottom input {
	width: 60px;
	height: 40px;
	float: right;
	margin-top: 10px;
	margin-left: 10px;
	margin-right: 7px;
	border-radius: 5px;
}
</style>
<script>

function fileDel(fileDelFlag, serial, part){
	location.href = "Main.jsp?inc_content=../work/modify.jsp&part="+part+"&fileDelFlag=" + fileDelFlag +"&serial=" + serial;
}

function fileDel2(fileDelFlag2, serial, part){
	location.href = "Main.jsp?inc_content=../work/modify.jsp&part="+part+"&fileDelFlag2=" + fileDelFlag2 +"&serial=" + serial;
}

function fileDownload(filename){
	url = "Main.jsp?inc_content=../work/filedownload.jsp&filename="+filename;
	wind = window.open(url, "win", "");
}
</script>
</head>
<body>
	<jsp:useBean id="workboardVo" class="workboard.WorkboardVo"></jsp:useBean>
	<jsp:setProperty property="*" name="workboardVo" />
	<%	
	Workboard b = new Workboard();
	b.setVo(workboardVo);
	WorkboardVo v = b.view();
	
	String part = request.getParameter("part");
	
%>
	<form name='writeform' method='post'
		action="Main.jsp?inc_content=../work/modify_result.jsp"
		enctype="multipart/form-data">
		<div class="worksmodify-main">
			<div class="worksmodify-top">

				<div class="worksmodify-top-title">제 목</div>
				<div class="worksmodify-top-item">
					<input type="text" name='subject' value=<%=v.getSubject() %>>
				</div>


				<div class="worksmodify-top-title2">작 성 자</div>
				<div class="worksmodify-top-item2">
					<input type="text" name='mid' readonly value=<%=v.getMid() %>>
					<input type="hidden" name="serial" value=<%=v.getSerial() %>>
					<input type="hidden" name="part" value=<%=part %>>
				</div>

				<div class="worksmodify-top-title3">첨부파일</div>
				<div class="worksmodify-top-item3">
					<%
					if(v.getFilename() == null || workboardVo.getFileDelFlag().equals("del")){
				%>
				
					File : <input type="file" name='newfilename' id='workinsert_upload_btn'>
					<p/>
					<%}else{ %>
					File : <a href='#' onClick="fileDownload('<%=v.getFilename()%>')"><%=v.getFilename() %></a>
					<input type='button' value='삭제'
						onclick="fileDel('del', '<%=v.getSerial() %>', '<%=part%>')"><p/>
						<%} %>
					<%
					if(v.getFilename2() == null || workboardVo.getFileDelFlag2().equals("del2")){
				%>
					Img : <input type="file" name='newfilename2' id='workinsert_upload_btn'>
		
					<%}else{ %>
					<p/>
					Img : <a href='#' onClick="fileDownload('<%=v.getFilename2()%>')"><%=v.getFilename2() %></a>
					<input type='button' value='삭제'
						onclick="fileDel2('del2', '<%=v.getSerial() %>', '<%=part%>')">
					<%} %>
				</div>
				
				
				<!-- modify 메소드에서 받아야할 변수들 --> 
				<input type='hidden' name='part' value='<%=part %>'>
				<input type="hidden"
						name="fileDelFlag" value=<%=workboardVo.getFileDelFlag() %>>
				<input type="hidden"
						name="fileDelFlag2" value=<%=workboardVo.getFileDelFlag2() %>>
				<input type="hidden" name="filename" value=<%=v.getFilename() %>>		
				<input type="hidden" name="filename2" value=<%=v.getFilename2() %>>
				<!-- modify 메소드에서 받아야할 변수들 끝 -->
				
				

				<div class="worksmodify-top-title4">내 용</div>
				<div class="worksmodify-top-item4">
					<textarea name='content' style="resize: none;"><%=v.getContent() %></textarea>
				</div>
			</div>
			<div class="worksmodify-bottom">
				<input type="button" value="취소"
					onclick="location.href='Main.jsp?inc_content=../work/Worksview.jsp&part=<%=v.getPart()%>'">
				<input type="submit" value="저장">
			</div>
		</div>
	</form>
</body>
</html>